﻿/*******************************************************************************
 * Copyright @ 2017 YunSpace.Framework 版权所有
 * Author: GaoTang
 * Description: YunSpace 快速开发平台
 * Website：http://www.yunspace.com.cn
*********************************************************************************/
#region USING SYSTEM
using YunSpace.Core;
using YunSpace.Domain.Entity.SiteMgr;
using YunSpace.Domain.IRepository.SiteMgr;
using YunSpace.Repository.SiteMgr;
using System.Collections.Generic;
using System.Linq;
#endregion

namespace YunSpace.Application.SiteMgr
{
    public class WithdrawCashApp
    {
        private IWithdrawCashRepository service = new WithdrawCashRepository();

        public List<WithdrawCashEntity> GetList(Pagination pagination, string queryJson)
        {
            var expression = ExtLinq.True<WithdrawCashEntity>();
            var queryParam = queryJson.ToJObject();
       
            return service.FindList(expression, pagination);
        }

        public WithdrawCashEntity GetForm(string keyValue)
        {
            return service.FindEntity(keyValue);
        }
        public void DeleteForm(string keyValue)
        {
            service.Delete(t => t.F_Id == keyValue);
        }
        public string  SubmitForm(WithdrawCashEntity withdrawcashEntity, string keyValue)
        {
            if (!string.IsNullOrEmpty(keyValue))
            {
                withdrawcashEntity.Modify(keyValue);
                service.Update(withdrawcashEntity);
            }
            else
            {
                withdrawcashEntity.Create();
                service.Insert(withdrawcashEntity);
            }
            return withdrawcashEntity.F_Id;
        }
    }
}

